package com.example.yunpicture.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.yunpicture.model.dto.space.SpaceAddRequest;
import com.example.yunpicture.model.dto.space.SpaceQueryRequest;
import com.example.yunpicture.model.entity.Space;
import com.example.yunpicture.model.entity.User;
import com.example.yunpicture.model.vo.SpaceVO;

/**
* @author Lenovo
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-03-26 15:45:14
*/
public interface SpaceService extends IService<Space> {
    /**
     * 创建空间
     * @param spaceAddRequest
     * @param loginUser
     * @return
     */
    public long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);
    /**
     * 查询条件
     * @param spaceQueryRequest
     * @return
     */
    public QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);

    /**
     * 获取封装后的空间信息
     * @param space
     * @return
     */
    public SpaceVO getSpaceVO(Space space);

    /**
     * 分页获取封装后的空间信息
     * @param spacePage
     * @return
     */
    public Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage);

    /**
     * 校验空间是否正确
     * @param space
     */
    public void validSpace(Space space,Boolean add);

    /**
     * 初始空间级别大小
     * @param space
     */
    public void fillSpaceBySpaceLevel(Space space);

    /**
     * 校验是否有空间权限
     * @param space
     * @param loginUser
     */
    public void checkSpaceAuth(Space space,User loginUser);
}
